const express = require('express');
const router = express.Router();
const Pagecontroller = require('./controller/Pagecontroller.js')
const Usercontroller = require('./controller/Usercontroller.js')
const Postcontroller = require('./controller/Postcontroller.js')
const Catecontroller = require('./controller/Catecontroller.js')





// 前端首页
// .get('/',pagesController.getIndexPage)
router.get('/', Pagecontroller.getindexpage)
    .get('/detail', Pagecontroller.getdetailpage)
    .get('/list', Pagecontroller.getlistpage)
    // .post('login', Usercontroller.login)
    // // 后端首页
    .get('/admin', Pagecontroller.getAdminindexpage)
    .get('/admin/comments', Pagecontroller.getAdmincommentspage)
    .get('/admin/categories', Pagecontroller.getAdmincategoriespage)
    .get('/admin/login', Pagecontroller.getAdminloginpage)
    .get('/admin/nav-menus', Pagecontroller.getAdminnavMenuspage)
    .get('/admin/password-reset', Pagecontroller.getAdminpasswordResetpage)
    .get('/admin/post-add', Pagecontroller.getAdminpostAddpage)
    .get('/admin/posts', Pagecontroller.getAdminPostspage)
    .get('/admin/profile', Pagecontroller.getAdminProfilepage)
    .get('/admin/settings', Pagecontroller.getAdminSettingspage)
    .get('/admin/slides', Pagecontroller.getAdminSlidesspage)
    .get('/admin/users', Pagecontroller.getAdminuSerspage)
    // .post('/login', Usercontroller.login)
    // 点击登录验证接口
    .post('/login', Usercontroller.login)
    // 转到posts页面的请求
    .get('/getAllpost', Postcontroller.getAllpost)
    .get('/getAllcate', Catecontroller.getAllcate)
// .get('/getAllcate', Catecontroller.getAllcate)




module.exports = router;